var mongoose = require('./setmongoose');

var zjxModel;
try{
    zjxModel = mongoose.model('zjx');
}catch(error){
    var zjxSchema = new mongoose.Schema({
        name: String,
        age: Number,
        sex: String,
        img: String,
        phone: String,
        email: String,
        password: String,
        // QQ登录相关字段
        qqOpenId: String,
        nickName: String,
        avatar: String,
        // 人脸识别相关字段
        personId: String, // 关联腾讯云人脸库中的personId
        faceId: String,   // 人脸ID
        faceRegistered: { type: Boolean, default: false }, // 是否已注册人脸
        createdAt: Date,
        updatedAt: Date,
    })
    zjxModel = mongoose.model('zjx', zjxSchema, 'zjx');
}


module.exports = zjxModel;